//
// Created by 吴锐 on 2022/2/25.
//

#include "iostream"

using namespace std;

class Person {
public:
    int a;
    int b;

//    Person operator+ (Person& person){
//        Person temp;
//        temp.a = this->a + person.a;
//        temp.b = this->b + person.b;
//        return temp;
//    }
};

Person operator+(Person& p1, Person& p2){
    Person temp;
    temp.a = p1.a + p2.a;
    temp.b = p1.b + p2.b;
    return temp;
}

void test01(){
    Person p1;
    Person p2;
    p1.a = 10;
    p1.b = 10;
    p2.a = 10;
    p2.b = 10;

    Person p3 = p1 + p2;

    cout << "p3.a = " << p3.a << " p3.b = " << p3.b << endl;
}

int main(){
    test01();
    return 0;
}